<?php

namespace app\common\model\mysql;

class GoodsSku extends BaseModel {

    /**
     * 一对一关联查询
     * @return mixed
     */
    public function goods() {
        return $this->hasOne(Goods::class, 'id', 'goods_id');
    }

    public function getNormalByGoodsId($goodsId = 0) {
        $where = [
            'goods_id' => $goodsId,
            'status'   => config('status.mysql.table_normal'),
        ];

        return $this->where($where)->select();
    }
}